package me.goldze.mvvmhabit.binding.viewadapter.progress

import android.widget.ProgressBar
import androidx.databinding.BindingAdapter
import com.qmuiteam.qmui.widget.QMUIProgressBar

object ViewAdapter {
    @JvmStatic
    @BindingAdapter("qmui_value")
    fun onQMUIProgressChanged(view: QMUIProgressBar, value: Int) {
        if (view.progress != value) {
            view.progress = value
        }
    }

    @JvmStatic
    @BindingAdapter("android:progress")
    fun onProgressChanged(view: ProgressBar, value: Int) {
        if (view.progress != value) {
            view.progress = value
        }
    }
}